﻿var page = 1;
var IsNext = true;
var isappend = true;
$(document).ready(function () {
    $(window).scroll(function () {
       //alert($(window).scrollTop()+"=="+$(document).height()+"=="+$(window).height());
        if ($(window).scrollTop() >= $(document).height() - $(window).height()-5) {   
            if (IsNext) {
                page++;
                getdatafromserver();
                appendtop();
            }else{
            	
            }
        }else{
        	//appendtop();
        }
    });
});
function appendtop(){
	if (isappend){
   	 $("body").append("<div id='uptop' src='' style='background:url(frame/images/uptop.png) no-repeat;width:60px;height:49px;position:fixed;right:30px;bottom:30px'></div>");
   	 //alert($("#uptop"));
   	 isappend = false;
   	 $("#uptop").click(function(){
   		 window.scrollTo(0,0); 
   		 $(this).remove();
   		 isappend = true;
   	 });
   }
	
}